package com.ruoyi.partybuilding.domain;

import java.util.Date;

import com.easy.query.core.annotation.EasyWhereCondition;
import com.easy.query.core.annotation.Navigate;
import com.easy.query.core.annotation.Table;
import com.easy.query.core.enums.RelationTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.partybuilding.common.EQuery.EQueryEntityLong;
import com.ruoyi.partybuilding.common.EQuery.IDeptEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.*;
/**
 * 组织信息对象 pb_org
 * 
 * @author he-liangliang@outlook.com
 * @date 2024-11-27
 */

@ApiModel(value = "组织信息",description = "")
@Table("pb_org")
@Data
public class Org extends IDeptEntity.LongId {
    //private static final long serialVersionUID = 1L;


    /** 组织名称，dept的冗余 ; */
    @ApiModelProperty(value = "组织名称")
    //@Excel(name = "组织名称",sort = 1)
    private String deptName;

    /** 组织简称 ; */
    @ApiModelProperty(value = "组织别称")
    @Excel(name = "组织别称",sort = 2)
    private String nickName;

    /** 组织类别,字典 ; */
//    @ApiModelProperty(value = "待删除,组织类别,不使用")
//    @Excel(name = "组织类别,字典")
//    private Long typeId;

    /** 成立时间 ; */
    @ApiModelProperty(value = "成立时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "成立时间", width = 30, dateFormat = "yyyy-MM-dd",sort = 4)
    private Date foundTime;

    /** 类别,字典 ; */
    @ApiModelProperty(value = "类别,字典pb_org_type")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @Excel(name = "类别",sort = 3,dictType="pb_org_type")
    private Long type;

    /** 位置 ; */
    @ApiModelProperty(value = "位置")
    @Excel(name = "位置")
    private String location;


    /** 系统部门id ; */
    @ApiModelProperty(value = "系统部门id")
   // @Excel(name = "系统部门id")
    private Long deptId;

    @Navigate(value = RelationTypeEnum.OneToOne,targetProperty = "deptId", selfProperty = "deptId")
    private SysDept dept;
    /** 单位名称 ; */
    @ApiModelProperty(value = "单位名称")
    @Excel(name = "单位名称",sort = 5)
    private String unitName;

    /** 单位类型 ; */
    @ApiModelProperty(value = "单位类型,字典pb_org_unit_type")
    @Excel(name = "单位类型",sort = 6,dictType="pb_org_unit_type")
    private Long unitType;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getDeptName())
            .append("nickName", getNickName())
            //.append("typeId", getTypeId())
            .append("foundTime", getFoundTime())
            .append("type", getType())
            .append("location", getLocation())
            .append("deptId", getDeptId())
            .append("unitName", getUnitName())
            .append("unitType", getUnitType())
            .toString();
    }
}
